ros-gst-bridge
Why do we need it?
- The
ros2_deepstreampackage cannot natively subscribe to the ROS2 image topic published by theros2_intel_realsensenode. - Using this package, however, we can take ROS2 image topics and input them into the Gstreamer pipeline of the
ros2_deepstreampackage as arosimagesrc(in that sense this package is like a bridge).- the
ros2_deepstreamnode has been modified accordingly
- the
- Note: If you do not use
ros-gst-bridge, theros2_intel_realsensenode will block both the Realsense RGB camera and the depth camera, so thatros2_deepstreamcannot access the Realsense RGB camera in the first place. So, you will have to find another workaround to get an RGB image stream forros2_deepstream. Using the car's main camera is possible, but then you must implement another perspective transformation inros2_intel_realsense. This idea, however, messes up ROS modularity and the resulting accuracy and performance of this method is also questionable. Therefore, I decided to stick to theros2_intel_realsensepackage's intended use.
Install
- switch to branch
dashingbefore building!!!
git clone https://github.com/pharath/ros-gst-bridge.git
cd path/to/ros-gst-bridge/
git checkout dashing
cd ../../dev_ws/
source /opt/ros/eloquent/setup.bash
colcon build
Source Script
The bridge will only work, if you source source_ws.sh:
# ====== "source_ws.sh" ========
echo "source /opt/ros/eloquent/setup.bash"
source /opt/ros/eloquent/setup.bash
echo "source install/local_setup.bash"
source install/local_setup.bash
if [ "$DISPLAY" != ":0" ]; then
echo "export DISPLAY=:0"
export DISPLAY=:0
else
echo "DISPLAY variable is already set to ':0'."
fi
# For gst_bridge:
#
# Note: If you don't set GST_PLUGIN_PATH, you must use the
# option "--gst-plugin-path=install/gst_bridge/lib/gst_bridge/"
# in the gst-launch-1.0 pipeline
export GST_PLUGIN_PATH=install/gst_bridge/lib/gst_bridge/
Video Explanation (by the Developer of ros-gst-bridge)

Troubleshooting
Errors
Error 1
error: package directory 'gst_pipeline' does not exist ros2
- fix: instead of
# from compile.sh
colcon build --executor parallel --parallel-worker ${USE_CORES} --cmake-args " -DCMAKE_BUILD_TYPE=${CONFIG_CMAKE_BUILD_TYPE}" " -DJETSON_DEVICE=${DEVICE}" " -DCMAKE_EXPORT_COMPILE_COMMANDS=ON" --symlink-install`
just run
colcon build --executor parallel --parallel-worker ${USE_CORES} --symlink-install